package com.blb.examsystem.service.Impl;

import com.blb.common.entity.User;
import com.blb.examsystem.dao.UserDao;
import com.blb.examsystem.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public User login(String username, String password) {
        List<User> users = userDao.selectByUsernameAndPassword(username, password);
        if (users != null && users.size()>0){
            return users.get(0);
        }
        return null;
    }
}
